﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Web.Http;
using log4net.Config;

namespace Barry.BarbeSystem
{
    public static class WebApiConfig
    {
        public static void Register(HttpConfiguration config)
        {
            string path = AppDomain.CurrentDomain.BaseDirectory;
            FileInfo file = new FileInfo(path + "/log4net.config");
            //log4net.Util.LogLog.InternalDebugging = true;
            XmlConfigurator.ConfigureAndWatch(file);

            config.Routes.MapHttpRoute(
                name: "DefaultApi",
                routeTemplate: "api/{controller}/{id}",
                defaults: new { id = RouteParameter.Optional }
            );
        }
    }
}
